package com.example.myactiviti.common.util;

import com.example.myactiviti.common.exception.BizException;

import java.util.function.Function;

public class TryInvoker {

    public static <R,T> R invoker(Function<T,R> function,T req){
        try {
            return function.apply(req);
        }catch (Exception e){
            throw new BizException("执行失败",e);
        }
    }
}
